﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StockEngine
{
    public class BackupCode
    {
        //        using System;
        //using System.Collections.Generic;
        //using System.Linq;
        //using System.Text;
        //using System.Windows;
        //using System.Windows.Controls;
        //using System.Windows.Data;
        //using System.Windows.Documents;
        //using System.Windows.Input;
        //using System.Windows.Media;
        //using System.Windows.Media.Imaging;
        //using System.Windows.Navigation;
        //using System.Windows.Shapes;
        //using StockEngine;
        //using System.Collections.ObjectModel;
        //using System.Net;
        //using System.IO;
        //using Microsoft.Windows.Controls;
        //using System.Windows.Controls.DataVisualization.Charting;

        //namespace StockEngine
        //{
        //    /// <summary>
        //    /// interaction logic for mainwindow.xaml
        //    /// </summary>
        //    public partial class mainwindow : window
        //    {
        //        public observablecollection<quote> quotes { get; set; }
        //        WebClient wC = new WebClient();
        //        List<dayData> name = new List<dayData>();

        //        public MainWindow()
        //        {
        //            InitializeComponent();
        //        }

        //        private string GetImageURL(string Serie)
        //        {
        //            try
        //            {
        //                string firstURL = "http://finance.yahoo.com/q/hp?s=HM-B.ST+Historical+Prices";
        //                string secondURL = wC.DownloadString(firstURL);
        //                string subString = secondURL.Substring(0, secondURL.IndexOf("Download to Spreadsheet"));
        //                subString = subString.Substring(subString.LastIndexOf("href=\"") + 6, subString.LastIndexOf("\"><img") - subString.LastIndexOf("href=\"") - 6);
        //                return subString;
        //            }
        //            catch
        //            {
        //                return null;
        //            }
        //        }

        


        //        private void button1_Click(object sender, RoutedEventArgs e)
        //        {

        //            Quotes = new ObservableCollection<Quote>();

        //            //Some example tickers
        //            Quotes.Add(new Quote("AAPL"));
        //            /*
        //            Quotes.Add(new Quote("MSFT"));
        //            Quotes.Add(new Quote("INTC"));
        //            Quotes.Add(new Quote("IBM"));
        //            Quotes.Add(new Quote("RVBD"));
        //            Quotes.Add(new Quote("AMZN"));
        //            Quotes.Add(new Quote("BIDU"));
        //            Quotes.Add(new Quote("SINA"));
        //            Quotes.Add(new Quote("THI"));
        //            Quotes.Add(new Quote("NVDA"));
        //            Quotes.Add(new Quote("AMD"));
        //            Quotes.Add(new Quote("DELL"));
        //            Quotes.Add(new Quote("WMT"));
        //            Quotes.Add(new Quote("GLD"));
        //            Quotes.Add(new Quote("SLV"));
        //            Quotes.Add(new Quote("V"));
        //            Quotes.Add(new Quote("V"));
        //            Quotes.Add(new Quote("MCD"));
        //            */
        //            //get the data



        //            textBox1.Text = ReadCSV(GetImageURL(""));


        //            YahooStockEngine.Fetch(Quotes);


        //        }
        //    }
        //}

    }
}
